In the accessing of a shared resource from a plurality of processes, exclusion control is unnecessary if access is solely referential access but exclusion control does become necessary if there is even a single update access. For example, often there are circumstances where shared data that is constantly referred to is updated frequently. In order for the exclusion control mechanism to maintain consistency of shared data, there is a possibility that reference and update will be made to wait until the respective acquisition requests are allowed.
Exclusion control referred to as “read-write lock” offers an improvement that makes simultaneous reference possible. In cases where updating is involved, however, access is always made to wait until the processing that is in progress is completed. As a consequence, response time often is not uniform. With such read/write-lock exclusion control, a plurality of lock acquisition requests are allowed simultaneously when reference is had to a resource. When an update is made, however, only a single acquisition request is allowed, even to a process making reference. For this reason, even though an attempt may be made to perform reference while lock is in progress at update time, lock acquisition is not allowed and reference is made to wait until the lock prevailing at update time is released.
Further, even in cases where update is attempted, lock acquisition is not allowed and all referencing processes (processes that perform referential access) are made to wait until the lock is released.
When updating of some kind is performed, therefore, not only processes on the update side but also processes on the reference side are always made to wait for lock acquisition and situations in which processing falls behind arise. This makes it difficult to achieve more efficient, high-speed processing.
Patent Document 1 discloses a database exclusion control system that shortens the time required for exclusion of update and reference even with a database that does not possess a synonym function. Specifically, master records are stored in a master table together with generation starting numbers and generation end numbers assigned thereto, and valid generation numbers of master records to which reference is currently possible are stored in a generation management table. In a case where a master record is incorporated in the master table anew, the generation starting number of the master record is made larger than the valid generation numbers and the master record is incorporated. If reference to the master table is subsequently excluded and processing ends normally, then the valid generation number of this master record is updated to a number greater than the generation starting numbers and exclusion is released. Patent Document 2 discloses an arrangement in which a file is subjected to exclusion control block by block. During rollback of updating performed thus far, a block held temporarily in holding means, which temporarily holds a block prevailing prior to update and corresponding to a block currently being updated by a program, is used to make possible reference and update from another program to a block that is to be subjected to the rollback. Reference and updating of a block to undergo rollback can be performed preferentially without waiting for the end thereof and it is possible to raise the processing efficiency of programs when one file is referred to and updated simultaneously by a plurality of programs.
[Patent Document 1]
Japanese Patent Kokai Publication No. JP-P2002-132565A
[Patent Document 2]
Japanese Patent Kokai Publication No. JP-P2001-344142A